Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: chang assertr of test_worker_mgr_rate_limiter #1624

Merged
merged 1 commit into from
Sep 19, 2024

Conversation

Desiki-high
Copy link
Member

@Desiki-high Desiki-high commented Sep 19, 2024

Relevant Issue (if applicable)

image

image

Details

assert_eq!(mgr.prefetch_inflight.load(Ordering::Acquire), 3); and assert!(mgr.prefetch_inflight.load(Ordering::Acquire) <= 2); sometimes failed.
The reason is the worker threads may have already started processing the requests and decreased the counter before the main thread checks it.

  • change assert!(mgr.prefetch_inflight.load(Ordering::Acquire) = 3); to assert!(mgr.prefetch_inflight.load(Ordering::Acquire) <= 3);
  • thread::sleep(Duration::from_secs(1)); to thread::sleep(Duration::from_secs(2));

Types of changes

What types of changes does your PullRequest introduce? Put an x in all the boxes that apply:

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation Update (if none of the other choices apply)

Checklist

Go over all the following points, and put an x in all the boxes that apply.

  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@Desiki-high Desiki-high requested a review from a team as a code owner September 19, 2024 07:47
@Desiki-high Desiki-high requested review from imeoer, changweige and adamqqqplay and removed request for a team September 19, 2024 07:47
assert_eq!(mgr.prefetch_inflight.load(Ordering::Acquire), 3); and assert!(mgr.prefetch_inflight.load(Ordering::Acquire) <= 2); sometimes failed.
The reason is the worker threads may have already started processing the requests and decreased the counter before the main thread checks it.

- change assert!(mgr.prefetch_inflight.load(Ordering::Acquire) = 3); to assert!(mgr.prefetch_inflight.load(Ordering::Acquire) <= 3);
-  thread::sleep(Duration::from_secs(1)); to thread::sleep(Duration::from_secs(2));

Signed-off-by: Yadong Ding <ding_yadong@foxmail.com>
@Desiki-high Desiki-high changed the title tests: chang assertr from 3 to <=3 tests: chang assertr of test_worker_mgr_rate_limiter Sep 19, 2024
Copy link

codecov bot commented Sep 19, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.28%. Comparing base (849591a) to head (aa08180).
Report is 1 commits behind head on master.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1624   +/-   ##
=======================================
  Coverage   61.28%   61.28%           
=======================================
  Files         146      146           
  Lines       48156    48156           
  Branches    46123    46123           
=======================================
  Hits        29510    29510           
  Misses      17085    17085           
  Partials     1561     1561           
Files with missing lines Coverage Δ
storage/src/cache/worker.rs 62.53% <100.00%> (ø)

... and 2 files with indirect coverage changes

Copy link
Collaborator

@imeoer imeoer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@imeoer imeoer merged commit 742954e into dragonflyoss:master Sep 19, 2024
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants